<template>
  <el-select
    v-model="selectValue"
    placeholder="请选择"
    @change="changeEvent"
  >
    <el-option
      v-for="(item,index) in optionList"
      :key="index"
      :label="item.label"
      :value="item.value"
    />
  </el-select>
</template>
<script>
export default {
  name: 'GradSelect',
  props: {
    value: {
      type: [Number, String],
      default: ''
    }
  },
  data() {
    return {
      optionList: [
        { label: '年度', value: 1 },
        { label: '月度', value: 4 }
      ]
    }
  },
  computed: {
    selectValue: {
      get() {
        return this.value
      },
      set(val) {
        this.$emit('input', val)
      }
    }
  },
  created() {
  },
  methods: {
    changeEvent(val) {
      this.$emit('change', val)
    }
  }
}
</script>
